//
//  OAuthController.h
//  WeiboPad
//
//  Created by junmin liu on 10-10-5.
//  Copyright 2010 Openlab. All rights reserved.
//

#import <Foundation/Foundation.h>

@class OAuthEngine, OAuthController;

@protocol OAuthControllerDelegate <NSObject>
@optional
- (void) OAuthControllerFinished: (OAuthController *) controller pinCode:(NSString*)pin; 
- (void) OAuthControllerFailed: (OAuthController *) controller error:(NSError*)err;
- (void) OAuthControllerCanceled: (OAuthController *) controller;
@end

@interface OAuthController : UIViewController <UIWebViewDelegate> {	
	UIWebView						*_webView;
	UINavigationBar					*_navBar;	
	id <OAuthControllerDelegate>    _delegate;	
	BOOL							_loading;
    BOOL                            _firstLoad;
	UIToolbar						*_pinCopyPromptBar;
    UIButton *_rightButton;
    UIImage  *_navBackgroundImage;
}

@property (nonatomic, readwrite, assign) id <OAuthControllerDelegate> delegate;
@property (nonatomic, readonly) UINavigationBar *navigationBar;

-(void)setCancelButton:(UIButton*)button;
-(void)setNavigationBarBackgroundImage:(UIImage*)backImage;
-(void)setTitleLabel:(UILabel*)label;
-(void)starWithReqeust:(NSURLRequest*)request;
@end
